<%@ page contentType="text/html; charset=utf-8" language="java"  %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="thx" uri="/thx-tags" %>
<%@ taglib prefix="fun" uri="http://java.sun.com/jsp/jstl/functions" %>

<section class="content-header">
	<h1>
		字典管理<small>系统管理</small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
		<li><a href="#">系统管理</a></li>
		<li class="active">字典管理</li>
	</ol>
</section>

<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-md-12">
		   <div class="box">
		        <div class="box-header with-border">
		           <div class="row">
		           		<form class="search-panel" action="sys/dictName!list.action" name="search-form" result-container=".content-wrapper">
							<input type="text" name="entity.dicName" value="${entity.dicName}" class="form-control" placeholder="字典名称">
							<button type="button" class="btn btn-primary search-btn"  >搜索</button>
						</form>
		           </div>
		        </div>
		        <div class="box-body no-padding">
		            <div class="row">
		                <div class="col-sm-12">
		                    <table class="table table-bordered">
		                        <tr>
		                            <th>
										<button title="全选"
											class="btn btn-default btn-sm checkbox-toggle"
											data-toggle="tooltip" data-placement="left">
											<i class="fa fa-square-o"></i>
										</button>
									</th>
		                            <th>字典名称</th>
		                            <th>字典代码 </th>
		                            <th>字典类型</th>
		                            <th>操作</th>
		                        </tr>
								<c:if test="${empty list}">
					                <tr>
					                	<td colspan="5">
					                		暂无数据！
					                	</td>
					                </tr>
					            </c:if>
					            <c:forEach items='${list }' var="dicn">
									<tr>
										<td>
											<input type="checkbox" name="delId" value="${dicn.dicnId}"/>
										</td>
										<td>${dicn.dicName}</td>
										<td>${dicn.dicnCode}</td>
										<td><c:if test="${dicn.dicnType == '1'}">系统值</c:if><c:if test="${dicn.dicnType == '0'}">自定义</c:if> </td>
										<td>
											<button type="button"
													title="字典详情"
													data-toggle="tooltip"
													data-placement="bottom"
													open-url="sys/dictName!view.action?id=${dicn.dicnId}"
													class="btn btn-default btn-sm btn-open-form">
													<i class="fa fa-sticky-note-o"></i>
											</button>
											<thx:privileged id="sys_dict_edit">
												<button type="button"
														title="字典修改"
														data-toggle="tooltip"
														data-placement="bottom"
														open-url="sys/dictName!input.action?id=${dicn.dicnId}"
														class="btn btn-default btn-sm btn-open-form">
														<i class="fa fa-edit"></i>
												</button>
											</thx:privileged>
					                        <thx:privileged id="sys_dict_del">
												<button type="button"
														title="删除"
														data-toggle="tooltip"
														data-placement="bottom"
														do-url="sys/dictName!delete.action?id=${dicn.dicnId}"
														load-url="sys/dictName!list.action"
														confirm-msg="确定要删除吗？"
														class="btn btn-default btn-sm btn-open-confirm-win">
														<i class="fa fa-trash"></i>
												</button>
											</thx:privileged>
										</td>
									</tr>
								</c:forEach>
		                    </table>
		                </div>
		            </div>
		        </div>
		        <!-- /.box-body -->
		        <div class="box-footer">
					 <!--分页区-->
					<div class="pagePanel">
			           	 <thx:pages pageNo="page.curPage" total="page.totalPage"  theme="number">
							<s:param name="entity.dicName" value="entity.dicName"></s:param>
						</thx:pages>
					</div>
					 <!--底部操作区-->
					<div class="handlePanel">
						  <thx:privileged id="sys_dict_delMulti">
							 <a title="批量删除" class="a-btn btn-open-confirm-win btn-get-checkbox-ids" href="javascript:void(0);"
								do-url="sys/dictName!delMulti.action?delId="
								load-url="sys/dictName!list.action"
								confirm-msg="确定要删除吗？"
								style="margin-right: 5px">
								<span class="fa fa-trash"></span>
								<span class="text">删除</span>
							</a>
				          </thx:privileged>
						  <thx:privileged id="sys_dict_edit">
						   	 <a title="字典添加" class="a-btn btn-open-form" open-url="sys/dictName!input.action" >
						   	 	<span class="fa fa-plus"></span>
								<span class="text">新增</span>
							 </a>
						  </thx:privileged>
					</div>
				</div>
		    </div>
		</div>
	</div>
</section>

<script>
	$( function() {
		list.init();
		page.init();
	});
</script>